<link rel="stylesheet" href="__STATIC__/style/login.css" media="all">
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login">
    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="name"></label>
                <input type="text" name="name" lay-verify="required" id="name" placeholder="登录名" class="layui-input" value="{:session('user.name')}">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-cellphone" for="mobile"></label>
                <input type="text" name="mobile" id="mobile" lay-verify="required|phone" placeholder="手机号码" class="layui-input" value="{:session('user.mobile')}">
            </div>
<!--            <div class="layui-form-item">-->
<!--                <label class="layadmin-user-login-icon layui-icon layui-icon-link" for="email"></label>-->
<!--                <input type="text" name="email" id="email" placeholder="邮箱账号" class="layui-input" value="{:session('user.email')}">-->
<!--            </div>-->

            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit lay-filter="LAY-user-forget-submit">保存</button>
            </div>
            <input type="hidden" name="id"  value="{:session('user.id')}">
        </div>
    </div>
</div>
<script>
    layui.use('form', function(){
        var form = layui.form;
        form.render();

        form.on('submit(LAY-user-forget-submit)', function(data){
            var field = data.field; //获取提交的字段
            $.post("{:url('admin/site/changeAccount')}",field,function (ret) {
                if (ret.code == 0){
                    layer.msg(ret.msg,{icon:6,time:1000},function () {
                        window.location.href = "{:url('admin/site/logout')}";
                    })
                }else{
                    layer.msg(ret.msg,{icon:5,time:1000})
                }
            });
        });
    });
</script>
